package com.xxl.job.executor.persistence.beans;

import com.google.gson.annotations.SerializedName;

import java.math.BigDecimal;


/**
 * Created by yzm on 2019/06/14.
 */
public class VehicleSignData implements BaseData {

    @SerializedName(value = "ID", alternate = {"id", "Id"})
    private String id;
    @SerializedName(value = "POINTTYPE", alternate = {"pointType"})
    private Integer pointType;
    @SerializedName(value = "VEHICLEID", alternate = {"vehicleId"})
    private String vehicleId;
    @SerializedName(value = "MANUALVEHICLEID", alternate = {"manualVehicleId"})
    private String manualVehicleId;
    @SerializedName(value = "TAILVEHICLEID", alternate = {"tailVehicleId"})
    private String tailVehicleId;
    private String listNo;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getPointType() {
        return pointType;
    }

    public void setPointType(Integer pointType) {
        this.pointType = pointType;
    }

    public String getVehicleId() {
        return vehicleId;
    }

    public void setVehicleId(String vehicleId) {
        this.vehicleId = vehicleId;
    }

    public String getManualVehicleId() {
        return manualVehicleId;
    }

    public void setManualVehicleId(String manualVehicleId) {
        this.manualVehicleId = manualVehicleId;
    }

    public String getTailVehicleId() {
        return tailVehicleId;
    }

    public void setTailVehicleId(String tailVehicleId) {
        this.tailVehicleId = tailVehicleId;
    }

    public String getListNo() {
        return listNo;
    }

    public void setListNo(String listNo) {
        this.listNo = listNo;
    }

    @Override
    public String findStringByKey(String key) throws Exception {
        String ret = "#{$NOT_FOUND$}#";
        switch (key) {
            case "ID": ret = getId();break;
            case "VEHICLEID": ret = getVehicleId();break;
            case "MANUALVEHICLEID": ret = getManualVehicleId();break;
            case "TAILVEHICLEID": ret = getTailVehicleId();break;
            case "LISTNO": ret = getListNo();break;
            default:break;
        }
        if (ret != null && ret.equals("#{$NOT_FOUND$}#")) {
            throw new Exception("VehicleSignData未匹配到数据:"+key);
        }
        return ret;
    }

    @Override
    public BigDecimal findNumberByKey(String key) throws Exception {
        BigDecimal ret = null;
        switch (key) {
            case "POINTTYPE": ret = new BigDecimal(getPointType());break;
            default:break;
        }
        if (ret == null) {
            throw new Exception("VehicleSignData未匹配到数据:"+key);
        }
        return ret;
    }
}
